home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
Z-Misc Series
/
(k)zb.d64
/
bigdump'nec.src
< prev
next >
Wrap
Text File
|
2007-03-01
|
4KB
|
341 lines
; HIGH-RES SCREEN DUMP ROUTINE
; V4.0 4/18/84 (C) W. LOUIE
; MODIFIED BY PETER FOILES FOR
; NEC 8023 10/14/84
;
; ASSEMBLE IN HIGH RAM [$CA00].
; [ SYS 51712 ] TO DUMP SCREEN.
; PRESS POUND KEY TO ABORT DUMP.
;
; HIGH-RES SCREEN MAY BE DUMPED
; AT ANY TIME. BIT-MAP SCREEN
; IMAGE LIES UNTOUCHED BELOW
; SYSTEM ROM AT [$E000].
;
;
; KERNAL / SYSTEM EQUATES
SCNKEY = $FF9F
SETLFS = $FFBA
SETNAM = $FFBD
OPEN = $FFC0
CLOSE = $FFC3
CHKOUT = $FFC9
CHROUT = $FFD2
CLALL = $FFE7
GETIN = $FFE4
TIMER = $DC0E
BUFFER = $CE00
PRTPAT = $CFF0
ADDR1 = $CFFA
ADDR2 = $CFFB
ROW = $CFFC
COL = $CFFD
TEMP1 = $CFFE
TEMP2 = $CFFF
TEMP3 = $CF50
TEMP4 = $CF51
;
; ZERO PAGE LOCATIONS
BITMAP = $8B
MAPHI = $8C
BUFR = $8D
BUFHI = $8E
FLAG = $8F
;
; ASSEMBLE IN HIGH RAM
*= $CA00
;
; DISABLE INTERRUPTS
LDA TIMER
STA TEMP4
AND #$FE
STA TIMER
; OPEN THE PRINTER [ OPEN4,4,25 ]
LDA #$04
TAX
LDY #$19
JSR SETLFS
LDA #$00
TAX
TAY
JSR SETNAM
JSR OPEN
LDX #$04
JSR CHKOUT
; SET UP FOR INCREMENTAL MODE
; AND 8 DOT LINE SPACING
LDA #$1B
JSR CHROUT
LDA #$5B
JSR CHROUT
LDA #$1B
JSR CHROUT
LDA #$54
JSR CHROUT
LDA #$31
JSR CHROUT
LDA #$36
JSR CHROUT
; SCREEN BIT MAP LOCATION - $E000
LDA #$00
STA BITMAP
STA ADDR1
STA ROW
LDA #$E0
STA MAPHI
STA ADDR2
; BUFFER LOCATION - $CE00
NEWROW LDA #$00
STA BUFR
LDA #$CE
STA BUFHI
; SET FLAG TO ZERO
LDA #$00
STA FLAG
; SET COLUMN COUNT TO ZERO
STA COL
; LOAD BUFFER WITH 1 ROW
;
; SAVE 6510 I/O REGISTER AND
; DISABLE EVERYTHING TO ALLOW
; RAM TO BE READ INSTEAD OF ROM
LDA $01
STA TEMP1
LDA #$00
STA $01
;
LOAD LDY #$00
VICROW LDA (BITMAP),Y
LDX #$00
EPSCOL ASL A
ROR PRTPAT,X
INX
CPX #$08
BCC EPSCOL
INY
CPY #$08
BNE VICROW
; MOVE PRTPAT TO BUFFER
LDY #$00
MOVE LDA PRTPAT,Y
STA (BUFR),Y
INY
CPY #$08
BNE MOVE
; INCREMENT BUFFER INDEX BY 8
CLC
LDA BUFR
ADC #$08
STA BUFR
LDA BUFHI
ADC #$00
STA BUFHI
; INCREMENT BIT MAP INDEX BY 8
CLC
LDA BITMAP
ADC #$08
STA BITMAP
LDA MAPHI
ADC #$00
STA MAPHI
; INCREMENT COLUMN COUNT
INC COL
; FINISHED WITH ROW <40 CHAR.> ?
LDA COL
CMP #$28
BNE LOAD
; BUFR NOW CONTAINS A ROW IN
; THE NEC COLUMN FORMAT.
;
; ENABLE SYSTEM ROM AGAIN
LDA TEMP1
STA $01
;
;
; SET UP PRINTER FOR GRAPHICS MODE
; 8 COL/CHAR X 40 CHAR = 320 COL
PRINT LDA #$1B
JSR CHROUT
LDA #$53
JSR CHROUT
LDA #$30
JSR CHROUT
LDA #$36
JSR CHROUT
LDA #$34
JSR CHROUT
LDA #$30
JSR CHROUT
; SEND BUFFER TO PRINTER
LDX #$00
OUT1 LDA BUFFER,X
JSR TOP
INX
CPX #$A0
BNE OUT1
LDX #$00
OUT2 LDA BUFFER+$A0,X
JSR TOP
INX
CPX #$A0
BNE OUT2
; DUMP BUFFER WITH CR AND LF
LDA #$0D
JSR CHROUT
LDA #$0A
JSR CHROUT
LDA #$1B
JSR CHROUT
LDA #$53
JSR CHROUT
LDA #$30
JSR CHROUT
LDA #$36
JSR CHROUT
LDA #$34
JSR CHROUT
LDA #$30
JSR CHROUT
LDX #$00
OUT3 LDA BUFFER,X
JSR BOTTOM
INX
CPX #$A0
BNE OUT3
LDX #$00
OUT4 LDA BUFFER+$A0,X
JSR BOTTOM
INX
CPX #$A0
BNE OUT4
LDA #$0D
JSR CHROUT
LDA #$0A
JSR CHROUT
; POUND KEY PRESSED ?
JSR SCNKEY
JSR GETIN
CMP #$5C
; YES, ABORT SCREEN DUMP
BEQ QUIT
; INCREMENT ROW COUNT
NEXT INC ROW
; DUMPED ALL 25 ROWS ?
LDA ROW
CMP #$19
BEQ QUIT
; INCREMENT BIT MAP INDEX BY 320
CLC
LDA ADDR1
ADC #$40
STA ADDR1
STA BITMAP
LDA ADDR2
ADC #$01
STA ADDR2
STA MAPHI
; GET THE NEXT ROW
JMP NEWROW
;
; END OF DUMP ROUTINE
;
; RESET PRINTER MODE
QUIT LDA #$1B
JSR CHROUT
LDA #$41
JSR CHROUT
LDA #$0D
JSR CHROUT
; CLOSE 4,4 - RESET I/O CHANNELS
LDA #$04
JSR CLOSE
JSR CLALL
; ENABLE INTERRUPTS
LDA TEMP4
STA TIMER
; RETURN TO COMAL
RTS
;
TOP STA TEMP1
AND #$01
STA TEMP2
ASL A
ADC TEMP2
STA TEMP2
LDA TEMP1
AND #$02
ASL A
STA TEMP3
ADC TEMP2
STA TEMP2
LDA TEMP3
ASL A
ADC TEMP2
STA TEMP2
LDA TEMP1
AND #$04
ASL A
ASL A
STA TEMP3
ADC TEMP2
STA TEMP2
LDA TEMP3
ASL A
ADC TEMP2
STA TEMP2
LDA TEMP1
AND #$08
ASL A
ASL A
ASL A
STA TEMP3
ADC TEMP2
STA TEMP2
LDA TEMP3
ASL A
ADC TEMP2
JSR CHROUT
JSR CHROUT
RTS
BOTTOM STA TEMP1
AND #$10
LSR A
LSR A
LSR A
STA TEMP2
LSR A
ADC TEMP2
STA TEMP2
LDA TEMP1
AND #$20
LSR A
LSR A
STA TEMP3
ADC TEMP2
STA TEMP2
LDA TEMP3
LSR A
ADC TEMP2
STA TEMP2
LDA TEMP1
AND #$40
LSR A
STA TEMP3
ADC TEMP2
STA TEMP2
LDA TEMP3
LSR A
ADC TEMP2
STA TEMP2
LDA TEMP1
AND #$80
STA TEMP3
ADC TEMP2
STA TEMP2
LDA TEMP3
LSR A
ADC TEMP2
JSR CHROUT
JSR CHROUT
RTS